<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div class="after">
        <div class="son">
            son
        </div>
        after
    </div>
    <script>
        var son = document.querySelector('.son');
        var after = document.querySelector('.after');
        //1.第三个参数为true为捕获阶段
        /* son.addEventListener('click',function(){
            alert('son');
        },true); */
        son.addEventListener('click',function(e){
            alert('son');
            console.log(e.stopPropagation);
            
            if(e && e.stopPropagation){
                e.stopPropagation();
                console.log('ddd');
                
            }else{
                window.e.cancelBubble = true;//ie6~8
            }
        },false);
        //第三个参数不写或者为false为冒泡阶段
        after.addEventListener('click',function(){
            alert('after');
        },false);
        document.addEventListener('click',function(){
            alert('document');
        });
        //冒泡常用
    </script>
</body>
</html>